package com.unknowpupil.sell.converter;

import com.unknowpupil.sell.domain.OrderMaster;
import com.unknowpupil.sell.dto.OrderDTO;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @Classname: OrderMaster2OrderDTO
 * @Author: <a> w10g </a>
 * @CreateDate: Create in 2019/12/30 13:57
 * @Description:
 * @Version: 1.0
 */
public class OrderMaster2OrderDTO {
    public static OrderDTO convert(OrderMaster orderMaster){
        OrderDTO orderDTO = new OrderDTO();
        BeanUtils.copyProperties(orderMaster,orderDTO);
        return orderDTO;
    }
    /**
     * 功能描述: <br>
     * 〈转换对象〉
     *
     * @param: orderMasterList
     * @since: 1.0.0
     * @auther: w10g
     * @return: List<OrderDTO>
     * @Date: 2019/12/30 14:00
     */
    public static List<OrderDTO> convert(List<OrderMaster> orderMasterList){
        return orderMasterList.stream().map(e->convert(e)).collect(Collectors.toList());
    }
}
